from base.base import Base
from utils.db_utils import DBUtils
import time

class user_payment_config(Base):

    def modify_user_payment(self,pay_product_num,user_name):


        # 修改用户配置
        self.switch_node('modify_user_payment_config')
        self.logger.info('点击支付管理')
        self.click('pay_manage')
        self.logger.info('点击用户支付配置')
        self.click('user_payment_config')
        self.logger.info('点击修改')
        self.click('modify_payment_config')
        self.logger.info('输入用户编号')
        self.send_keys('pay_product_num',pay_product_num)
        time.sleep(3)
        self.logger.info('输入用户名')
        self.send_keys('user_name',user_name)
        time.sleep(3)
        self.logger.info('点击提交')
        self.click('button_commit')
        time.sleep(3)

        # sql = "SELECT product_name FROM rp_pay_product WHERE product_name = %s"
        # result = DBUtils().execute_query(sql, pay_product_num)
        # self.logger.info("数据库查询已修改的用户编号")
        # self.logger.info(result[0]['product_name'])
        # time.sleep(5)


